#!/bin/sh
# ohos local_engine 相关
export ENGINE_DIR=~/work/engine_build/engine
# export ENGINE_DIR=/home/hazy/work/engine_build/engine_wxp
export ENGINE_DEBUG=$ENGINE_DIR/src/out/ohos_debug_unopt_arm64
export ENGINE_PROFILE=$ENGINE_DIR/src/out/ohos_profile_arm64
export ENGINE_RELEASE=$ENGINE_DIR/src/out/ohos_release_arm64

# Flutter 相关
# export FLUTTER_STORAGE_BASE_URL=https://flutter-ohos.obs.cn-south-1.myhuaweicloud.com
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_HOME=~/work/gitcode/flutter_flutter
export PATH=$FLUTTER_HOME/bin:$PATH

# HarmonyOS 相关
# ---- last-sdk
# export OHOS_DIR=~/tools/ohos-v5.0.3.403/command-line-tools
# export HOS_SDK_HOME=$OHOS_DIR/sdk
# export DEVECO_SDK_HOME=$OHOS_DIR/sdk
# export PATH=$OHOS_DIR/tool/node/bin:$PATH
# export PATH=$OHOS_DIR/ohpm/bin:$PATH
# export PATH=$OHOS_DIR/hvigor/bin:$PATH
# --- current-sdk
export OHOS_DIR=~/tools/ohos-v5.0.13.100/command-line-tools
export HOS_SDK_HOME=$OHOS_DIR/sdk
export DEVECO_SDK_HOME=$OHOS_DIR/sdk
export PATH=$OHOS_DIR/tool/node/bin:$PATH
export PATH=$OHOS_DIR/ohpm/bin:$PATH
export PATH=$OHOS_DIR/hvigor/bin:$PATH

export HDC_HOME=$DEVECO_SDK_HOME/$(ls $DEVECO_SDK_HOME | head -n 1)/openharmony/toolchains
export PATH=$HDC_HOME:$PATH

export OHOS_NDK_HOME=$DEVECO_SDK_HOME/$(ls $DEVECO_SDK_HOME | head -n 1)/openharmony/native
export PATH=$OHOS_NDK_HOME/build-tools/cmake/bin:$OHOS_NDK_HOME/llvm/bin:$PATH

# 签名工具相关
# export SIGN_TOOL_HOME=~/tools/developtools_hapsigner/autosign
# export PATH=~/tools/gradle-7.5/bin:$PATH

# Java 相关
export JAVA17=~/tools/jdk-17
export PATH=$JAVA17/bin:$PATH

# engine 相关
export PATH=~/tools/depot_tools:$PATH

# Android 
export ANDROID_HOME=~/tools/android_sdk
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH

# 其他
alias proxy="source ~/proxy.sh"
source ~/proxy.sh set
# HDC 远程调试
export HDC_SERVER=192.168.8.106
export HDC_SERVER_PORT=8710

# local
export DEVICE=$(hdc -s $HDC_SERVER:$HDC_SERVER_PORT list targets)

alias fbuildD="flutter build hap --local-engine=$ENGINE_DEBUG --debug"
alias fbuildP="flutter build hap --local-engine=$ENGINE_PROFILE --profile"
alias fbuildR="flutter build hap --local-engine=$ENGINE_RELEASE --release"
alias frunD="flutter run -d $DEVICE --local-engine=$ENGINE_DEBUG --debug"
alias frunP="flutter run -d $DEVICE --local-engine=$ENGINE_PROFILE --profile"
alias frunR="flutter run -d $DEVICE --local-engine=$ENGINE_RELEASE --release"

alias dockerRun="docker run -it --rm ubuntu:22.04 bash"

